package com.shujia

object Demo18Implicit02 {
  def main(args: Array[String]): Unit = {
    implicit val defaultPrefix:String = "giegie"
    // 2、隐式转换变量
    def addPrefix(word: String)(implicit prefix: String = " default prefix"): String = {
      word + "-" + prefix
    }

    println(addPrefix("Hadoop")("大象"))
    println(addPrefix("Hive")("蜂象"))
    println(addPrefix("HBase")("鲸鱼"))
    println(addPrefix("Spark")("火花"))
    println(addPrefix("moumoumou")())
    println(addPrefix("moumoumou"))


  }

}
